package com.zmn.mcc.persistence.interfaces.role;

import com.zmn.common.dto.StatusDTO;
import com.zmn.mcc.model.entity.role.McRole;
import com.zmn.mcc.model.entity.role.McRoleQuery;
import com.zmn.mcc.model.entity.role.RoleIdAndDayLimit;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author heguanghua
 * @since 2020/04/14 10:50
 */
public interface RoleDao {

    McRole findByKey(Integer roleId);

    List<McRole> listPageByQuery(McRoleQuery query);

    List<McRole> listByQuery(McRoleQuery query);

    List<McRole> listByIds(List<Integer> ids);

    List<Integer> listRoleIdByQuery(McRoleQuery query);

    /**
     * 描述: 根据角色id集合、状态查询查询前溯天数
     *
     * @param status 状态 1:停用；2：启用
     * @param roleIdList 员工id集合
     * @return List<RoleIdAndDayLimit>
     * @author xujie
     * @since 2021/05/28
     **/
    List<RoleIdAndDayLimit> listRoleIdAndDayLimitByRoleIdListAndStatus(@Param("roleIdList") List<Integer> roleIdList,
                                                                       @Param("status") Integer status);

    Integer countByQuery(McRoleQuery query);


    Integer updateByKey(McRole role);

    Integer updateStatus(McRole role);
    Integer updateStatusBatch(StatusDTO dto);

    Integer updateSort(McRole role);


    Integer insert(McRole role);


    Integer deleteByKey(Integer roleId);

}
